public class MapBinaryData {
    public static class Block {
        public static class Building {
            public final byte id, lvl;
            public Building(byte id, byte lvl) {
                this.id = id;
                this.lvl = lvl;
            }
        }
        public final Building[] buildings;
        public final short belongCity;
        public final byte terrain;
        public Block(Building[] buildings, short belongCity, byte terrain) {
            this.buildings = buildings;
            this.belongCity = belongCity;
            this.terrain = terrain;
        }
    }
    public static class City {
        public final short capitalx, capitaly;
        public final short belongCountry;
        public final String name;
        public final byte lvl;
        public City(short capitalx, short capitaly, short belongCountry, String name, byte lvl) {
            this.capitalx = capitalx;
            this.capitaly = capitaly;
            this.belongCountry = belongCountry;
            this.name = name;
            this.lvl = lvl;
        }
    }
    public static class Country {
        public final String name;
        public final short capital, faction;
        public final byte red, green, blue;
        public Country(String name, short capital, short faction, byte red, byte green, byte blue) {
            this.name = name;
            this.capital = capital;
            this.faction = faction;
            this.red = red;
            this.green = green;
            this.blue = blue;
        }
    }
    public final String mapName;
    public final short width, height, city_cnt, country_cnt, faction_cnt;
    public final int block_cnt;
    public final Block[] blocks;
    public final City[] cities;
    public final Country[] countries;
    public MapBinaryData(String name, short width, short height, short city_cnt, short country_cnt, short faction_cnt, 
      Block[] blocks, City[] cities, Country[] countries) {
        this.mapName = name;
        this.width = width;
        this.height = height;
        this.block_cnt = width * height;
        this.city_cnt = city_cnt;
        this.country_cnt = country_cnt;
        this.faction_cnt = faction_cnt;
        this.blocks = blocks;
        this.cities = cities;
        this.countries = countries;
    }
}